﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Portal.Core;
using Portal.Cms.Model;
using Portal.Cms.Utility;

namespace Portal.Cms.Cpv.Render
{
    public class CheckUnPublishingButtonLink : WorkflowButtonLinkStatusTemplate
    {
        public override string ServiceId
        {
            get
            {
                return "UnPublishing";
            }
        }

        public override string ServiceName
        {
            get
            {
                return "Hiển khi đã phát hành";
            }
        }

        public override AjaxOut CheckStatus(string SiteId, CheckWorkflowButtonLinkStatus OCheckWorkflowButtonLinkStatus)
        {
            CmsDataCls OCmsData = CmsUtility.CreateCmsBussinessProcess(SiteId).CreateCmsProcess(SiteId).CreateCmsDataModel(null, SiteId, OCheckWorkflowButtonLinkStatus.ObjectId);
            AjaxOut OAjaxOut = new AjaxOut();
            OAjaxOut.RetBoolean = OCmsData.IsPublic == 1;
            return OAjaxOut;
        }
    }
}
